package com.ch.home.testMapper;

import com.ch.home.bean.DishRecipes;
import com.ch.home.mapper.restDishMapper.DishRecipesMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.LinkedList;

/**
 * Created by CHEN on 2019/8/28.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class testDishRecipesMapper {

    @Autowired
    DishRecipesMapper dishRecipesMapper;


    @Test
    public void testGetDishRecipes(){

        LinkedList<DishRecipes> dishRecipes = dishRecipesMapper.getDishRecipes(new DishRecipes(null, 1, null, null, null, null));

        System.out.println(dishRecipes );

    }

    @Test
    public void testGetDishRecipesAndSource(){
        LinkedList<DishRecipes> dishRecipesAndSource = dishRecipesMapper.getDishRecipesAndSource(new DishRecipes(null, 1, null, null, null, null));

        System.out.println(dishRecipesAndSource );
    }


    @Test
    public  void testAddDishRecipes(){
        DishRecipes dishRecipes = new DishRecipes( null,1,"油烧热",2,null,null);
        dishRecipesMapper.addDishRecipes(dishRecipes);
        System.out.println(dishRecipes );


    }

    @Test
    public void testUpdateDishRecipes(){

        int i = dishRecipesMapper.updateDishRecipes(new DishRecipes(2, null, "油烧热，番茄下锅", null, null, null));
        System.out.println(i);

    }


}
